package com.ruowei.modules.foodOrder.domain;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;

import javax.persistence.*;

import java.io.Serializable;
import java.time.Instant;

/**
 * 商品属性选项表
 */
@ApiModel(description = "商品属性选项表")
@Entity
@Table(name = "attribute_options")
@Cache(usage = CacheConcurrencyStrategy.NONSTRICT_READ_WRITE)
public class AttributeOptions implements Serializable {

    private static final long serialVersionUID = 1L;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Long id;

    /**
     * 选项编码
     */
    @ApiModelProperty(value = "选项编码")
    @Column(name = "option_code")
    private String optionCode;

    /**
     * 选项名称
     */
    @ApiModelProperty(value = "选项名称")
    @Column(name = "option_name")
    private String optionName;

    /**
     * 属性编码
     */
    @ApiModelProperty(value = "属性编码")
    @Column(name = "attribute_code")
    private String attributeCode;

    /**
     * 状态
     */
    @ApiModelProperty(value = "状态")
    @Column(name = "status")
    private Boolean status;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间")
    @Column(name = "create_time")
    private Instant createTime;

    // jhipster-needle-entity-add-field - JHipster will add fields here, do not remove
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getOptionCode() {
        return optionCode;
    }

    public AttributeOptions optionCode(String optionCode) {
        this.optionCode = optionCode;
        return this;
    }

    public void setOptionCode(String optionCode) {
        this.optionCode = optionCode;
    }

    public String getOptionName() {
        return optionName;
    }

    public AttributeOptions optionName(String optionName) {
        this.optionName = optionName;
        return this;
    }

    public void setOptionName(String optionName) {
        this.optionName = optionName;
    }

    public String getAttributeCode() {
        return attributeCode;
    }

    public AttributeOptions attributeCode(String attributeCode) {
        this.attributeCode = attributeCode;
        return this;
    }

    public void setAttributeCode(String attributeCode) {
        this.attributeCode = attributeCode;
    }

    public Boolean isStatus() {
        return status;
    }

    public AttributeOptions status(Boolean status) {
        this.status = status;
        return this;
    }

    public void setStatus(Boolean status) {
        this.status = status;
    }

    public Instant getCreateTime() {
        return createTime;
    }

    public AttributeOptions createTime(Instant createTime) {
        this.createTime = createTime;
        return this;
    }

    public void setCreateTime(Instant createTime) {
        this.createTime = createTime;
    }
    // jhipster-needle-entity-add-getters-setters - JHipster will add getters and setters here, do not remove

    @Override
    public boolean equals(Object o) {
        if (this == o) {
            return true;
        }
        if (!(o instanceof AttributeOptions)) {
            return false;
        }
        return id != null && id.equals(((AttributeOptions) o).id);
    }

    @Override
    public int hashCode() {
        return 31;
    }

    @Override
    public String toString() {
        return "AttributeOptions{" +
            "id=" + getId() +
            ", optionCode='" + getOptionCode() + "'" +
            ", optionName='" + getOptionName() + "'" +
            ", attributeCode='" + getAttributeCode() + "'" +
            ", status='" + isStatus() + "'" +
            ", createTime='" + getCreateTime() + "'" +
            "}";
    }
}
